package com.chipcoo.web.servlet.view;

import com.chipcoo.ResponseResult;
import com.chipcoo.captcha.geetest.GeetestLib;
import com.chipcoo.utils.ValidateUtils;
import com.chipcoo.web.utils.ViewUtils;
import com.chipcoo.web.utils.WebUtils;

import java.util.Map;

public class FastJsonJsonView extends com.alibaba.fastjson.support.spring.FastJsonJsonView {
   /* @Override
    protected Object filterModel(Map<String, Object> model) {
        if( model.containsKey("responseResult") ) {
            ResponseResult responseResult = null;

            Object objectResponseResult = model.get("responseResult");
            if (null == objectResponseResult) {
                responseResult = new ResponseResult();
            } else {
                responseResult = (ResponseResult) objectResponseResult;
            }


            Object captchaChallenge = ValidateUtils.getCaptchaChallenge();
            if(null!=captchaChallenge){
                if(null==responseResult.getData() || responseResult.getData() instanceof Map) {
                    responseResult.put("gt", GeetestLib.CAPTCHA_ID)
                            .put("challenge", captchaChallenge);
                }
            }


            return responseResult;
        }else {
            return  super.filterModel(model);
        }
    }*/
}
